/* 作业1 插入函数
    void insetElement(ArrayList *list,int index,int element){
    if(index<0||index>=list->size){
        fprintf(stderr,"数组索引越界！\n");
        exit(EXIT_FAILURE);
    }list->size++;
    for (int i = list->size; i >index; i--){
        list->array[i+1] = list->array[i ];
    }
    list->array[index]=element;}
    作业2 单向链表修改元素
    void changeList(LinkList *list,int originalElement, int newElement){
    ListNode *current=list->head->next;
    while(current!=NULL && current->data!=originalElement){
    current=current->next;
    }
    current->data=newElement;
}




 */

//作业3 实现双向链表
#include<stdio.h>
#include"./heads/doublelist.h"

void testDoubleNode();

int main() {


    printf("\n测试双向链表：\n");
    testDoubleNode();

    return 0;
}


void testDoubleNode(){
    //创建链表
    LinkDouble list= creatLinkDouble();
    //向头部添加元素
    addToHead(&list,5);
    addToHead(&list,6);
    //向尾部添加元素
    addToTail(&list,2);
    addToTail(&list,1);
    //打印链表
    printf("链表中的元素：");
    printDouble(&list);
    printf("\n");
    printf("移除链表中的5： ");
    remove_Element(&list,5);
    printDouble(&list);
    printf("\n");
    printf("修改链表中的数据1改为7：");
    changeDoubleList(&list,1,7);
    printDouble(&list);
    printf("\n");


//尽大力了 555555



}